<?php
/**
 * @file
 * Implements all form related hooks
 */

/**
 * Implementation of hook_form().
 */
function race_form(&$node) {
  
  $form['title'] = array(
    '#type' => 'textfield', 
    '#title' => t('Title'), 
    '#required' => TRUE, 
    '#default_value' => $node->title, 
    '#weight' => -5);
    
  $form['body'] = array(
    '#type' => 'textarea', 
    '#title' => t('Body'), 
    '#default_value' => ($node->body ? $node->body : ""), 
    '#rows' => 5, 
    '#required' => TRUE);
  // $form['body_filter']['format'] = filter_form($node->format);
  
  $form['state'] = array(
    '#type' => 'select',
    '#title' => t('Select box'),
    '#default_value' => $node->state,
    '#options' => array(
      Constants::$STATE_SIGNUP => t('Signup Phase'),
      Constants::$STATE_ASSIGNMENT => t('Assigned Phase')
    ),
    '#description' => t('Please choose an phase.') 
  );
  
  $form['signup'] = array(
    '#type' => 'textarea', 
    '#title' => t('Signup'), 
    '#default_value' => ($node->signup ? $node->signup : Defaults::$SIGNUP),
    '#rows' => 10, 
    '#required' => TRUE);
  
  $form['assignment'] = array(
    '#type' => 'textarea', 
    '#title' => t('Assignment'), 
    '#default_value' => ($node->assignment ? $node->assignment : Defaults::$ASSIGNMENT),
    '#rows' => 10, 
    '#required' => TRUE);
  
  $form['config'] = array(
    '#type' => 'textarea', 
    '#title' => t('Config'), 
    '#default_value' => ($node->config ? $node->config : Defaults::$CONFIG),
    '#rows' => 5, 
    '#required' => TRUE);
  
  
  return $form; 
}